<!DOCTYPE html>
<html>
    <head>
    <title>Kab</title>
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.css" />
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
    <script>
	    $(document).bind("mobileinit", function(){
	      $.extend(  $.mobile , {
	    	  ajaxFormsEnabled : false
	      });
	    });
    </script>
    <script type="text/javascript" src="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js"></script>
</head>
<body>
<div data-role="page">

	<div data-role="header">
		<h1>Kli Olami</h1>
		<a href="/kli" data-icon="gear" class="ui-btn-right" rel="external">Map</a>
	</div><!-- /header -->

	<div data-role="content">
		<p>Please fill in your details</p>

	    <form action="/profile" method="POST">

	            <div data-role="fieldcontain">
	                <label for="Locale" class="select">I watch lessons in:</label>
	                <select name="Locale" id="Locale">

	                	<?php

	                		$locales = array('ar_AR','es_LA','en_US','he_IL','fr_FR','de_DE','it_IT','ru_RU','tr_TR','ja_JP','zh_TW');

	                		if ( !in_array( $this->usr->Locale , $locales ) ){
	                			echo '<option value="" selected="selected">Select</option>';
	                		}
	                	?>
						<option value="ar_AR"<?php if ( $this->usr->Locale == 'ar_AR'){ echo ' selected="selected"'; } ?>>Arabic</option>
	                    <option value="es_LA"<?php if ( $this->usr->Locale == 'es_LA'){ echo ' selected="selected"'; } ?>>Spanish</option>
	                    <option value="en_US"<?php if ( $this->usr->Locale == 'en_US'){ echo ' selected="selected"'; } ?>>English</option>
	                    <option value="he_IL"<?php if ( $this->usr->Locale == 'he_IL'){ echo ' selected="selected"'; } ?>>Hebrew</option>
	                    <option value="fr_FR"<?php if ( $this->usr->Locale == 'fr_FR'){ echo ' selected="selected"'; } ?>>French</option>
	                    <option value="de_DE"<?php if ( $this->usr->Locale == 'de_DE'){ echo ' selected="selected"'; } ?>>German</option>
	                    <option value="it_IT"<?php if ( $this->usr->Locale == 'it_IT'){ echo ' selected="selected"'; } ?>>Italian</option>
	                    <option value="ru_RU"<?php if ( $this->usr->Locale == 'ru_RU'){ echo ' selected="selected"'; } ?>>Russian</option>
	                    <option value="tr_TR"<?php if ( $this->usr->Locale == 'tr_TR'){ echo ' selected="selected"'; } ?>>Turkish</option>
	                    <option value="ja_JP"<?php if ( $this->usr->Locale == 'ja_JP'){ echo ' selected="selected"'; } ?>>Japanese</option>
	                    <option value="zh_TW"<?php if ( $this->usr->Locale == 'zh_TW'){ echo ' selected="selected"'; } ?>>Chinese</option>
	                </select>
	            </div>

                <div data-role="fieldcontain">

	                <h2>!!! IMPORTANT !!!</h2>
	                <p>Consider setting maximum privacy if you are living in the Arab counries!</p>

                    <label for="Privacy" class="select">Privacy level:</label>
                    <select name="Privacy" id="Privacy">
                        <option value="0"<?php if ( $this->usr->Privacy == 0){ echo ' selected="selected"'; } ?>>Country</option>
                        <option value="1"<?php if ( $this->usr->Privacy == 1){ echo ' selected="selected"'; } ?>>First Name, Country</option>
                        <option value="2"<?php if ( $this->usr->Privacy == 2){ echo ' selected="selected"'; } ?>>First Name, City, Country</option>
                        <option value="3"<?php if ( $this->usr->Privacy == 3){ echo ' selected="selected"'; } ?>>First Name, Last Name, City, Country</option>
                        <option value="4"<?php if ( $this->usr->Privacy == 4){ echo ' selected="selected"'; } ?>>Facebook, First Name, Last Name, City, Country</option>
                    </select>
                </div>

                <?php

                if ( $this->HomeSet == false ){

	                if ( $this->LL ){
	                ?>

		            <div data-role="fieldcontain">
		            <fieldset data-role="controlgroup">
		                <legend>My home:</legend>
		                <input type="checkbox" name="Home" id="Home" class="custom" value="<?php echo $_COOKIE['LL']; ?>"/>
		                <label for="Home">Set <?php echo $this->LL; ?> as my home location</label>
		            </fieldset>
		            </div>

	                <?php }else{ ?>

	                <p>Visit <a href="/location" rel="external">My Location</a> to obtain your location to set up "Home" property</p>

	                <?php }
	                }
                ?>

	            <button type="submit">Update</button>
	    </form>
	</div><!-- /content -->

	<div data-role="footer">
        <div data-role="navbar">
			<ul>
                <li><a href="/" rel="external">Home</a></li>
                <li><a href="/profile" class="ui-btn-active" rel="external">Profile</a></li>
                <li><a href="/location" rel="external">My Location</a></li>
                <li><a href="/activity" rel="external">Activity</a></li>
			</ul>
		</div
	</div><!-- /footer -->
</div><!-- /page -->
<?php echo $this->partial('ga.phtml'); ?>
</body>
</html>